* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.input-section {
    padding: 30px;
    background: #f8f9fa;
}

.tab-buttons {
    display: flex;
    margin-bottom: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tab-button {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: #3498db;
    color: white;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#text-input {
    width: 100%;
    height: 120px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    resize: vertical;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#text-input:focus {
    outline: none;
    border-color: #3498db;
}

.upload-area {
    border: 3px dashed #bdc3c7;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.upload-area:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.upload-area label {
    color: #3498db;
    cursor: pointer;
    font-weight: 600;
}

#file-input {
    display: none;
}

#image-preview {
    margin: 20px 0;
    text-align: center;
}

#image-preview img {
    max-width: 300px;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 15px;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-details {
    margin-top: 20px;
    color: #7f8c8d;
}

.result-section {
    padding: 30px;
    background: white;
}

#model-container { 
    width: 100%; 
    height: 450px; 
    min-height: 400px; 
    background: #f8f9fa; 
    /* 新增：强制硬件加速和重排 */ 
    transform: translateZ(0); 
    backface-visibility: hidden; 
    perspective: 1000; 
} 


#model-container canvas { 
    border-radius: 8px; 
    /* 新增：确保canvas显示 */ 
    display: block !important; 
    opacity: 1 !important; 
    visibility: visible !important; 
    /* 强制重绘 */ 
    transform: translateZ(0); 
}



.result-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.feedback {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feedback button {
    width: auto;
    padding: 10px 20px;
    margin: 0;
}

#feedback-good {
    background: linear-gradient(135deg, #27ae60, #229954);
}

#feedback-bad {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .input-section, .result-section {
        padding: 20px;
    }
    
    .model-preview {
        height: 400px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .feedback {
        justify-content: center;
    }
}